/**
 *  主要用于统一主管 周、月、季 评时
 *  带教人与主管为同一人的情况
 *  数据还是有外部传入
 */
import React from 'react';
import { Typography, Divider } from 'antd';
import AssessAbilityDesc from './AssessAbilityDesc';
import AssessAbilityDetail from './AssessAbilityDetail';
import AssessAbility from './AssessAbility';
import AssessTotal from './AssessTotal';

export default function AssessLeader({ form, data = {}, detail = {}, assessTotal = {} }) {
    const { teacherEqLeader } = data;
    const onlyLeader = teacherEqLeader === 1;

    return (
        <>
            <AssessAbilityDesc data={data} />
            {!onlyLeader && (
                <>
                    <Typography.Paragraph>
                        <strong>带教人评估</strong>
                    </Typography.Paragraph>

                    <AssessAbilityDetail data={detail} record={data} />

                    <Divider />
                </>
            )}

            <Typography.Paragraph>
                <strong>我的评估</strong>
            </Typography.Paragraph>

            <AssessAbility data={data} form={form} />

            <AssessTotal
                onlyLeader={onlyLeader}
                data={assessTotal}
                style={{ marginTop: 16, marginLeft: 36 }}
                levels={data?.assessAbility?.levels}
            />
        </>
    );
}
